#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : xuexiaohua
# @time    : 2025/8/20 18:09
# @function: the script is used to do something.
# @version :
import requests

from netPan123.utils.log_util import logger


class BaseApi:

    def send_api(self, req):
        '''
        对request完成二次封装
        req格式需要字典
        {
            "method": "GET",
            "url": "xxx",
            "params": {},
            "json": {},
            ......
        }
        :return:
        '''
        logger.info(f"接口请求参数：{req}")
        r = requests.request(**req)
        logger.info(f"接口响应：{r.text}")
        return r
